package com.itany.mall.entity;

import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Order extends MallData implements Cloneable, Serializable {
	private static final long serialVersionUID = 1L;
	// private Long id;
	private String orderNum;
	private Date createTime;
	private Double price;
	private Long userId;
	private User user;

	@Override
	public Object clone() {
		try {
			Order o = (Order) super.clone();
			o.user = (User) this.user.clone();
			o.createTime = (Date) this.createTime.clone();
			return o;
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
			return null;
		}
	}

}
